package com.itheima.d2_collection_traverse;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo1 {

    public static void main(String[] args) {
        Collection<String> c =new ArrayList<>();
        c.add("aaa");
        c.add("bbb");
        System.out.println(c);

        Iterator<String> iterator=c.iterator();
        while (iterator.hasNext()){
            String ele = iterator.next();
            System.out.println(ele);

        }
    }
}
